package com.starhub.engine.document.result;

import com.starhub.engine.document.dto.DocContentDto;
import com.starhub.engine.document.entity.DocumentInfo;
import lombok.Data;

@Data
public class DocumentDealResult {
    private boolean success;
    private String message;
    private String id;
    private DocumentInfo data;
    private String content;
    private DocContentDto docContent;

    public static DocumentDealResult success(String id) {
        DocumentDealResult result = new DocumentDealResult();
        result.setSuccess(true);
        result.setId(id);
        return result;
    }

    public static DocumentDealResult success(String id, DocContentDto docContent) {
        DocumentDealResult result = new DocumentDealResult();
        result.setSuccess(true);
        result.setId(id);
        result.setDocContent(docContent);
        return result;
    }

    public static DocumentDealResult success(String id,String content) {
        DocumentDealResult result = new DocumentDealResult();
        result.setSuccess(true);
        result.setId(id);
        result.setContent(content);
        return result;
    }

    public  static DocumentDealResult success(String id, DocumentInfo data) {
        DocumentDealResult result = new DocumentDealResult();
        result.setSuccess(true);
        result.setId(id);
        result.setData(data);
        return result;
    }

    public static DocumentDealResult fail(String message) {
        DocumentDealResult result = new DocumentDealResult();
        result.setSuccess(false);
        result.setMessage(message);
        return result;
    }   
}
